package com.version1_4.controller;

import com.version1_4.service.MsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by reeveslee on 16/5/7.
 */
@Controller
public class MsgController {

    @Autowired
    private MsgService msgService;

    /**
     * 查看回复消息
     *
     * @param userId
     * @param lastId
     * @return
     */
    @RequestMapping(value = "/msg/topicReply/{userId}/{lastId}", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    @ResponseBody
    public String topicReplyMsg(@PathVariable("userId") int userId, @PathVariable("lastId") int lastId) {
        return msgService.topicReplyMsg(userId, lastId);
    }

    @RequestMapping(value = "/msg/topicPraise/{userId}/{lastId}", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    @ResponseBody
    public String topicPraiseMsg(@PathVariable("userId") int userId, @PathVariable("lastId") int lastId) {
        return msgService.topicPraiseMsg(userId, lastId);
    }

}
